#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 2e5 + 10;

int n;
int s[N], f[N], d[N];

void solve(){
    cin >> n;
    
    for(int i = 1; i <= n; i ++) cin >> s[i];
    for(int i = 1; i <= n; i ++) cin >> f[i];

    int cur = 0, endTime = -1;

    while(cur + 1 <= n){
        if(s[cur + 1] >= endTime){
            d[cur + 1] = f[cur + 1] - s[cur + 1];
            endTime = f[cur + 1];
        }else{ // s[cur + 1] < endTime
            d[cur + 1] = f[cur + 1] - endTime;
            endTime = f[cur + 1];
        }
        cur ++;
    }

    for(int i = 1; i <= n; i ++) cout << d[i] << " ";
    cout << '\n';
    
}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while(T--){
        solve();
    }


    return 0;
}